package com.itfreer.data.input.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

import com.itfreer.form.api.entity.EntityBase;
import com.itfreer.form.api.reflect.DictionaryField;

/**
 * 数据导入配置
 */
@Entity(name = "data_input_config_item")
public class InputConfigItemEntity extends EntityBase implements Serializable {

	private static final long serialVersionUID = -7828937287884523173L;

	/**
	 * 元数据信息ID 主键
	 */
	@Id
	@Column(name = "id", length = 50, nullable = false)
	private String id;

	/**
	 * 外建，元数据ID值
	 */
	@Column(name = "s_mid", nullable = true)
	private String mid;

	/**
	 * 排序值
	 */
	@Column(name = "i_order", nullable = true)
	private Integer order;

	/**
	 * 字段名称
	 */
	@Column(name = "s_name", nullable = true)
	private String name;

	/**
	 * 字段别名
	 */
	@Column(name = "s_aliasName", nullable = true)
	private String aliasName;

	/**
	 * 字段类型
	 */
	@Column(name = "s_datatype", nullable = true)
	@DictionaryField(dictionaryName = "f_datatype", toFieldName = "dataTypeName")
	private String dataType;

	/**
	 * 字段类型名称
	 */
	private String dataTypeName;

	/**
	 * 是否是主键
	 */
	@Column(name = "b_key", nullable = true)
	private Boolean key;

	/**
	 * 是否可以为空
	 */
	@Column(name = "b_allowNull", nullable = true)
	private Boolean allowNull;

	/**
	 * 长度
	 */
	@Column(name = "i_maxlen", nullable = true)
	private Integer maxlen;

	/**
	 * 小数位长度
	 */
	@Column(name = "d_decimaldigits", nullable = true)
	private Integer decimaldigits;

	/**
	 * 字典域是否为ID值
	 */
	@Column(name = "b_dicid", nullable = true)
	private Boolean dicid;

	/**
	 * 字典域
	 */
	@Column(name = "d_dictionaryname", nullable = true)
	private String dictionaryName;

	public void setMid(String mid) {
		this.mid = mid;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setOrder(Integer order) {
		this.order = order;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setAliasName(String aliasName) {
		this.aliasName = aliasName;
	}

	public void setDataType(String dataType) {
		this.dataType = dataType;
	}

	public String getDataTypeName() {
		return dataTypeName;
	}

	public void setDataTypeName(String dataTypeName) {
		this.dataTypeName = dataTypeName;
	}

	public void setKey(Boolean isKey) {
		this.key = isKey;
	}

	public void setAllowNull(Boolean allowNull) {
		this.allowNull = allowNull;
	}

	public void setMaxlen(Integer maxlen) {
		this.maxlen = maxlen;
	}

	public Integer getDecimaldigits() {
		return decimaldigits;
	}

	public void setDecimaldigits(Integer decimaldigits) {
		this.decimaldigits = decimaldigits;
	}

	public void setDictionaryName(String dictionaryName) {
		this.dictionaryName = dictionaryName;
	}

	/**
	 * 外建，元数据ID值
	 */
	public String getMid() {
		return mid;
	}

	/**
	 * 元数据信息ID 主键
	 */
	public String getId() {
		return id;
	}

	/**
	 * 排序值
	 */
	public Integer getOrder() {
		return order;
	}

	/**
	 * 字段名称
	 */
	public String getName() {
		return name;
	}

	/**
	 * 字段别名
	 */
	public String getAliasName() {
		return aliasName;
	}

	/**
	 * 字段类型
	 */
	public String getDataType() {
		return dataType;
	}

	/**
	 * 是否是主键
	 */
	public Boolean getKey() {
		return key;
	}

	/**
	 * 是否可以为空
	 */
	public Boolean getAllowNull() {
		return allowNull;
	}

	/**
	 * 长度
	 */
	public Integer getMaxlen() {
		return maxlen;
	}

	public Boolean getDicid() {
		return dicid;
	}

	public void setDicid(Boolean dicid) {
		this.dicid = dicid;
	}

	/**
	 * 字典域
	 */
	public String getDictionaryName() {
		return dictionaryName;
	}
}
